require 'win32ole'

def kill_process(name)
    wmi = WIN32OLE.connect("winmgmts://")
    processes = wmi.ExecQuery("select * from win32_process where name='#{name}'")
    for process in processes
        process.terminate()
        sleep 1
    end
end